﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataSync.Entity;
using log4net;
using System.Xml.Linq;

namespace DataSync.Proc.Writer
{
    public abstract class DataSyncWriterBase : IDataSyncWriter
    {
        private static ILog log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
        public virtual void Close()
        {

        }

        public virtual int Execute(IList<Dictionary<string, ColData>> data)
        {
            return data.Count;
        }

        public void Init(XElement xmlnode)
        {
            this.ReadConfig(xmlnode);
            log.DebugFormat("Writer 初始化完成");
        }
        protected virtual void ReadConfig(XElement xmlnode)
        { }


        public virtual void PostExecute()
        {
            log.Debug("Writer PostExecute");
        }

        public virtual void PreExecute()
        {
            log.Debug("Writer PreExecute");
        }
    }
}
